source("/home/jc227089/evo-dispersal/KBGrad/KBGradfunctions.R")
setwd("/home/jc227089/SRE/KB/Adap/expansion/data")

args=(commandArgs(TRUE))

#evaluate the arguments
# input arguments will be fID
for(i in 1:length(args)) {
	 eval(parse(text=args[[i]]))
}


stable.domain<-50

K<-30
lmda<-10
b<-0
n<-2*stable.domain*K
spX<-stable.domain
ngens<-100
Hmean<-0
Dmean<-0
h2H<-0.5
h2D<-h2H
VPH<-0.25
VPD<-0.05
nreps<-1

out<-vector(mode="list", length=nreps)
for (ii in 1:nreps){
	repl<-mother(n=n, spX=spX, K=K, lambda=lmda, b=b, ngens=ngens, Hmean=Hmean, 
		Dmean=Dmean, h2H=h2H, h2D=h2D, VPH=VPH, VPD=VPH, evovar=TRUE, 
		stable.domain=stable.domain)
	out[[ii]]<-repl
}
  	
save(out, file=paste("expansion", fID, ".RData", sep=""))


	

